package com.gmail.yesguxun.util;

import android.content.Context;
import android.view.Display;
import android.view.WindowManager;

public class DeviceInfo {
	static Context mContex = null;
	static Display mDisplay = null;
	
	static public void setContext(Context context)
	{
		mContex = context;
	}
	
	static private void checkDisplay()
	{
		if(mDisplay == null)
		{
			mDisplay = ((WindowManager) mContex.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
		}
	}
	
	
	static public int getScreenWidth()
	{
		checkDisplay();
		
		return mDisplay.getWidth();
	}
	
	static public int getScreenHeight()
	{
		checkDisplay();
		
		return mDisplay.getHeight();
	}
}
